package com.example.test.aop;

import org.aspectj.lang.ProceedingJoinPoint;
import org.aspectj.lang.annotation.Around;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class InsertAspect {
	
//	@Pointcut(value = "execution(public tk.mybatis.mapper.provider.base.BaseInsertProvider.insert(..))")
//	public void matchInsert() {}
	
	@Around("execution(* tk.mybatis.mapper.provider.base.BaseInsertProvider.insert(..))")
	public Object insertAround(ProceedingJoinPoint pjp) {
		try {
			String sql = (String) pjp.proceed();
			System.out.println("拦截到的sql："+sql);
			return sql;
		} catch (Throwable e) {
			e.printStackTrace();
		}
		return "...";
	}
}
